#!/usr/bin/python3
import sys
import c

"""
    Syntax: auto-indent input_filename output_filename
"""
infile = sys.argv[ 1 ]
outfile = None
if len( sys.argv ) > 2:
    outfile = sys.argv[ 2 ]

indentor = c.C( infile )
indentor.indent()
indentor.write( outfile )

if not outfile:
    outfile = infile
print( "output written to %s." % outfile )

